Skip to content

Fix get_wf_files to use git ls-files#4068

Open
jonasscheid wants to merge 2 commits intonf-core:devfrom
jonasscheid:fix/get-wf-files-use-git-ls-files
Open

Fix get_wf_files to use git ls-files#4068
jonasscheid wants to merge 2 commits intonf-core:devfrom
jonasscheid:fix/get-wf-files-use-git-ls-files

Conversation

@jonasscheid
Copy link
Contributor

Description

get_wf_files() uses fnmatch to filter files based on .gitignore patterns, but fnmatch does not implement gitignore semantics correctly. For example, a .gitignore entry work/ should match scripts/work/ at any depth, but fnmatch.fnmatch("scripts/work/file", "work/*") returns False. This causes pipeline_if_empty_null (the only caller) to walk and open every file in untracked directories — freezing indefinitely on pipelines with large Nextflow work directories.

Replace the manual .gitignore parsing + fnmatch approach with git ls-files, which natively respects all .gitignore rules. This matches the existing Pipeline.list_files() method that already uses this approach.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.81%. Comparing base (a800f44) to head (ff84a0e).

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant